# -*- coding: utf-8 -*-

import time
import random

from project.app import project_app

import logging

logger = logging.getLogger(__name__)


@project_app.task(bind=True, )
def test_task1(self, ):
    logger.info('test_task1 start')
    timeout = random.randint(4, 8)
    result = f'test_task1:timeout:{timeout}'
    logger.info(result)
    time.sleep(timeout)
    logger.info('test_task1 end')
    return result


@project_app.task(bind=True, )
def demo_task1(self, ):
    logger.info('demo_task1 start')
    timeout = random.randint(4, 8)
    result = f'demo_task1:timeout:{timeout}'
    logger.info(result)
    time.sleep(timeout)
    logger.info('demo_task1 end')
    return result
